package com.ken.spring.annotation;

import com.ken.spring.annotation.controller.UserController;
import com.ken.spring.annotation.repository.UserRepositoryInterf;
import com.ken.spring.annotation.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AnnotationMain {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("beans-annotation.xml");

//        TestObject testObject = (TestObject) ctx.getBean("testObject");
//        System.out.println(testObject);
        UserController userController = (UserController) ctx.getBean("userController");
        System.out.println(userController);
        userController.execute();
//        UserService userService = (UserService) ctx.getBean("userService");
//        System.out.println(userService);
//
//        UserRepositoryInterf userRepositoryInterf = (UserRepositoryInterf) ctx.getBean("userRepository");
//        System.out.println(userRepositoryInterf);
    }
}
